import request from '@/utils/request'

const prePath = "/warning";


//产品效期预警分页
export function productExpirePage(data) {
    return request({
        url: prePath + '/productExpire/page',
        method: 'post',
        data
    })
}

//产品效期预警导出
export function productExpireExcel(data) {
  return request({
    url: prePath + `/productExpire/excel`,
    method: 'post',
    responseType: 'blob',
    data
  })
}

//证照效期预警分页
export function licenseExpirePage(params) {
    return request({
        url: prePath + '/licenseExpire/page',
        method: 'get',
        params
    })
}
//证照效期预警分页
export function printLicenseExpire(params) {
    return request({
        url: prePath + '/licenseExpire/print',
        method: 'get',
        params
    })
}
//证照效期预警分页
export function exportLicenseExpire(params) {
    return request({
        url: prePath + '/licenseExpire/excel',
        method: 'get',
        responseType: 'blob',
        params
    })
}

//库存高低水位预警配置分页
export function warningStockConfigPage(params) {
    return request({
        url: prePath + '/stockConfigs/page',
        method: 'get',
        params
    })
}
export function warningStockConfigPageDetails(id) {
    return request({
        url: prePath + '/stockConfigs/'+id,
        method: 'get'
    })
}

//库存高低水位预警配置全部
export function warningStockConfigAll(params) {
    return request({
        url: prePath + '/stockConfigs/all',
        method: 'get',
        params
    })
}

//创建库存高低水位预警配置
export function createWarningStockConfig(data) {
    return request({
        url: prePath + '/stockConfigs',
        method: 'post',
        data
    })
}

//更新库存高低水位预警配置
export function updateWarningStockConfig(data) {
    return request({
        url: prePath + '/stockConfigs',
        method: 'put',
        data
    })
}

//更新库存高低水位预警配置
export function delWarningStockConfig(data) {
    return request({
        url: prePath + '/stockConfigs',
        method: 'delete',
        data
    })
}

//库存高低水位预警配置明细全部
export function warningStockConfigDetailAll(params) {
    return request({
        url: prePath + '/stockConfigDetails/all',
        method: 'get',
        params
    })
}

//库存预警分页
export function warningStockPage(params) {
    return request({
        url: prePath + '/warningStocks/page',
        method: 'get',
        params
    })
}

//库存预警生成领用申请单校验领出仓库库存中是否存在所选产品
export function isDepotHasProduct(data) {
  return request({
    url: prePath + '/warningStocks/isDepotHasProduct',
    method: 'post',
    data
  })
}
isDepotHasProduct

export function purchApplicationDetailByProductIds(data) {
  return request({
    url: prePath + "/warningStocks/purchApplicationDetail",
    method: "post",
    data
  });
}

export function useApplicationDetailByProductIds(data) {
  return request({
    url: prePath + "/warningStocks/useApplicationDetail",
    method: "post",
    data
  });
}

//库存预警分页
export function brandExpireWarning(params) {
    return request({
        url: prePath + '/brandExpireWarning/page',
        method: 'get',
        params
    })
}

//合同效期预警分页
export function contractExpireWarning(params) {
    return request({
        url: prePath + '/contractExpireWarning/page',
        method: 'get',
        params
    })
}

//产品期间预警菜单
export function bandQuantityExpireWarning(params) {
    return request({
        url: prePath + '/bandQuantityExpireWarning/page',
        method: 'get',
        params
    })
}
//产品期间预警菜单
export function bandQuantityExpireWarningAll(params) {
    return request({
        url: prePath + '/bandQuantityExpireWarning/all',
        method: 'get',
        params
    })
}